home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 3 / csmp-digest-v3-080 < prev    next >
Text File  |  1995-12-31  |  41KB  |  1,295 lines

  1. C.S.M.P. Digest             Wed, 25 Jan 95       Volume 3 : Issue 80
  2.  
  3. Today's Topics:
  4.  
  5.         Any special tricks for patching _Launch?
  6.         Auto Power on-off info anyone?
  7.         Bad Error in new MacTCP.h universal header file
  8.         Help! Regarding INITs
  9.         How do I do a scrolling list box?
  10.         Latest QuickTime Tech Notes
  11.         OpenDoc mailing list or FAQ?
  12.         Q: Bedrock Exception Library Questions
  13.         help with CLUT-Palette management
  14.  
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  18. (pottier@clipper.ens.fr).
  19.  
  20. The digest is a collection of article threads from the internet newsgroup
  21. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  22. regularly and want an archive of the discussions.  If you don't know what a
  23. newsgroup is, you probably don't have access to it.  Ask your systems
  24. administrator(s) for details.  If you don't have access to news, you may
  25. still be able to post messages to the group by using a mail server like
  26. anon.penet.fi (mail help@anon.penet.fi for more information).
  27.  
  28. Each issue of the digest contains one or more sets of articles (called
  29. threads), with each set corresponding to a 'discussion' of a particular
  30. subject.  The articles are not edited; all articles included in this digest
  31. are in their original posted form (as received by our news server at
  32. nef.ens.fr).  Article threads are not added to the digest until the last
  33. article added to the thread is at least two weeks old (this is to ensure that
  34. the thread is dead before adding it to the digest).  Article threads that
  35. consist of only one message are generally not included in the digest.
  36.  
  37. The digest is officially distributed by two means, by email and ftp.
  38.  
  39. If you want to receive the digest by mail, send email to listserv@ens.fr
  40. with no subject and one of the following commands as body:
  41.     help                                Sends you a summary of commands
  42.     subscribe csmp-digest Your Name     Adds you to the mailing list
  43.     signoff csmp-digest                 Removes you from the list
  44. Once you have subscribed, you will automatically receive each new
  45. issue as it is created.
  46.  
  47. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  48. Questions related to the ftp site should be directed to
  49. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  50. digest are available there.
  51.  
  52. Also, the digests are available to WAIS users.  To search back issues
  53. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  54. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  55.  
  56.  
  57. -------------------------------------------------------
  58.  
  59. >From valuefax@netcom.com (Pancomm)
  60. Subject: Any special tricks for patching _Launch?
  61. Date: Mon, 9 Jan 1995 05:35:42 GMT
  62. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  63.  
  64. Greetings,
  65.    Are there any special tricks for patching _Launch? I am trying to 
  66. patch _Launch to determine if a program from a particular set is being 
  67. started. I catch the launch of Multifinder on startup but after that I 
  68. don't catch anything. I suspect Multifinder overrides my patch and does 
  69. not bother to call my patch routine before or after it does its thing. 
  70. What am I doing wrong? My other patches (_ExitToShell, _Open, _Close) are 
  71. working fine so I am sure my method of patching is working. This is on 
  72. system 7.5 but earlier systems probable behave the same.
  73.  
  74.    Please help with any pointers or suggestions. Users of ValueFax and 
  75. myself will be very grateful.
  76.  
  77. TIA.
  78. Pancomm.
  79.  
  80. +++++++++++++++++++++++++++
  81.  
  82. >From haynes@asel.udel.edu (Carl W. Haynes III)
  83. Date: Mon, 09 Jan 1995 02:49:43 -0500
  84. Organization: Univ. of Delaware
  85.  
  86. In article <valuefaxD24I7J.50v@netcom.com>, valuefax@netcom.com (Pancomm) wrote:
  87.  
  88. > Greetings,
  89. >    Are there any special tricks for patching _Launch? I am trying to 
  90. > patch _Launch to determine if a program from a particular set is being 
  91. > started. I catch the launch of Multifinder on startup but after that I 
  92. > don't catch anything. I suspect Multifinder overrides my patch and does 
  93. > not bother to call my patch routine before or after it does its thing. 
  94.  
  95. I think you're right about Multifinder patching out _Launch, How about
  96. patching _InitGraf instead, or patching GetResource (looking for 'CODE'
  97. resource 0).
  98.  
  99. carl
  100.  
  101. -- 
  102. Get1Resource -- A Mac Programming WebZine
  103. http://www.asel.udel.edu/~haynes/g1r.html
  104.  
  105. +++++++++++++++++++++++++++
  106.  
  107. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  108. Date: Tue, 10 Jan 1995 09:38:15 +0800
  109. Organization: Department of Computer Science, University of Western Australia
  110.  
  111. In article <haynes-0901950249430001@abyss.asel.udel.edu>,
  112. haynes@asel.udel.edu (Carl W. Haynes III) wrote:
  113.  
  114. >In article <valuefaxD24I7J.50v@netcom.com>, valuefax@netcom.com (Pancomm)
  115. wrote:
  116. >
  117. >>    Are there any special tricks for patching _Launch? I am trying to 
  118. >> patch _Launch to determine if a program from a particular set is being 
  119. >> started. I catch the launch of Multifinder on startup but after that I 
  120. >> don't catch anything. I suspect Multifinder overrides my patch and does 
  121. >> not bother to call my patch routine before or after it does its thing. 
  122.  
  123. Yep.
  124.  
  125. >I think you're right about Multifinder patching out _Launch, How about
  126. >patching _InitGraf instead, or patching GetResource (looking for 'CODE'
  127. >resource 0).
  128.  
  129. Yep, patching _InitGraf is a better way of doing it.  Be careful if you do
  130. it that way though, things calling _InitGraf may not be applications.  For
  131. example any INIT that shows an icon calls _InitGraf.  There are also a
  132. variety of other, infrequently used, Toolbox traps that you can patch that
  133. most applications will call when they start up.
  134.  
  135. I have successfully managed to patch _Launch but I needed to prevent
  136. launches rather than just monitor them.  I wouldn't recommend my method (:
  137.  
  138. Don't you just wish that support for this was in the Process Manager???
  139.  
  140. Share and Enjoy.
  141. --
  142. Quinn "The Eskimo!"  "Ah, so that's the secret,
  143.                       if only Captain Bipto had known.
  144.  
  145. ---------------------------
  146.  
  147. >From david.matusow@gsfc.nasa.gov (David Matusow)
  148. Subject: Auto Power on-off info anyone?
  149. Date: Mon, 09 Jan 1995 11:01:15 -0500
  150. Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
  151.  
  152. I was wondering if anyone knows how apple's Auto Power On/Off control
  153. panel does the power on?  How does the program run when the Mac is off,
  154. and is there some way for us developers to do a similar thing?
  155.  
  156. Thanks,
  157. --David
  158.  
  159. -- 
  160. David Matusow
  161. NASA - GSFC
  162. email -> david.matusow@gsfc.nasa.gov
  163.  
  164. +++++++++++++++++++++++++++
  165.  
  166. >From Jeff@purple.com (Jeff Abrahamson)
  167. Date: 11 Jan 1995 22:07:17 -0500 (EST)
  168. Organization: Purple Software
  169.  
  170.  
  171. In article <david.matusow-0901951101150001@129.188.12.62>
  172. david.matusow@gsfc.nasa.gov (David Matusow) writes:
  173. >I was wondering if anyone knows how apple's Auto Power On/Off control
  174. >panel does the power on?  How does the program run when the Mac is off,
  175. >and is there some way for us developers to do a similar thing?
  176.  
  177. It's pretty clever, actually. It makes use, as you may have guessed since you
  178. posted this, of the Subspace Manager (see Develop, issue 7). When you request
  179. the Auto on/off control panel to turn your Mac on at a certain time, it uses
  180. the Subspace Manager to request a Mac in an alternate universe to signal your
  181. Mac at the appropriate time. The Subspace circuitry may be activated even when
  182. main power is off (it's a very low power device), and it is thus able to raise
  183. a power on signal, bringing up your Mac.
  184.  
  185. Note that the apparent lack of correlation between our time line and time lines
  186. in parallel universes allows the Mac in the parallel universe to send the
  187. signal to start your Mac almost immediately after receiving the signal from
  188. your Mac. This increases reliability, since it's unlikely the Mac in the
  189. alternate universe will be off when you need it. See the appropriate header
  190. files in the Subspace section of the MacOS SDK. (The SubspaceParamBlock has a
  191. field for time, although this is usually left zero, meaning default time.)
  192.  
  193. Originally Apple was going to use the Advanced Time Services Manager, but it
  194. was a bit tricky to signal the same Mac in the future, even with the ATSM-aware
  195. chips, and those chips were eventually cut by Apple anyway, canning the
  196. project.
  197.  
  198. Contact Jens Alfke for further information on ATSM. I think he wrote the
  199. definitive article on it last year in csmp....
  200.  
  201.  
  202.  Jeff Abrahamson
  203.  PDI
  204.  
  205.  jeff@purple.com
  206.  jeff31415@aol.com
  207.  
  208.  
  209.  
  210. ---------------------------
  211.  
  212. >From j-norstad@nwu.edu (John Norstad)
  213. Subject: Bad Error in new MacTCP.h universal header file
  214. Date: Sat, 07 Jan 1995 21:07:01 -0600
  215. Organization: Northwestern University
  216.  
  217. There's a bad error in the new MacTCP.h file in version 2.0a3 of Apple's
  218. universal headers (at least, in the copy on the new CodeWarrior Release 5
  219. CD). If your program uses MacTCP, and you are working with the new
  220. MacTCP.h file, this could be rather important.
  221.  
  222. TCPSendPB is defined as follows in MacTCP.h:
  223.  
  224. struct TCPSendPB {
  225.         SInt8           ulpTimeoutValue;
  226.         SInt8           ulpTimeoutAction;
  227.         SInt8           validityFlags;
  228.         UInt8           filler; /* Filler for proper byte alignment */
  229.         Boolean         pushFlag;
  230.         Boolean         urgentFlag;
  231.         Ptr             wdsPtr;
  232.         unsigned long   sendFree;
  233.         unsigned short  sendLength;
  234.         Ptr             userDataPtr;
  235. };
  236.  
  237. The filler byte is in the wrong place. The proper definition is:
  238.  
  239. struct TCPSendPB {
  240.         SInt8           ulpTimeoutValue;
  241.         SInt8           ulpTimeoutAction;
  242.         SInt8           validityFlags;
  243.         Boolean         pushFlag;
  244.         Boolean         urgentFlag;
  245.         UInt8           filler; /* Filler for proper byte alignment */
  246.         Ptr             wdsPtr;
  247.         unsigned long   sendFree;
  248.         unsigned short  sendLength;
  249.         Ptr             userDataPtr;
  250. };
  251.  
  252. For example, if you try to set the push flag with the bogus version of the
  253. MacTCP.h header file, you send up setting the urgent flag instead! This
  254. caused big problems with a new version of NewsWatcher I released
  255. yesterday.
  256.  
  257. Moral: People who live on the edge and are the first to use new
  258. development tools (from Apple or elsewhere) sometimes fall off and get
  259. what they deserve.
  260.  
  261. -- 
  262. John Norstad
  263. Academic Computing and Network Services
  264. Northwestern University
  265. j-norstad@nwu.edu
  266.  
  267. ---------------------------
  268.  
  269. >From u567510@csi.uottawa.ca (Patricke Coutue the Firste)
  270. Subject: Help! Regarding INITs
  271. Date: 29 Dec 1994 12:26:54 GMT
  272. Organization: Dept. of Computer Science, University of Ottawa
  273.  
  274. On the subject of INITs, is there a way to time when the INIT runs? I want
  275. an INIT I am running to execute AFTER QuickTime, cause I want the INIT
  276. to play a .moov. Mind you, I get the "unimplemented trap" crash, which
  277. is incredibly annoying.
  278.  
  279. I am a complete and utter novice, any help with this project appreciated.
  280.  
  281.  
  282.  
  283.  
  284. +++++++++++++++++++++++++++
  285.  
  286. >From gurgle@dnai.com (Pete Gontier)
  287. Date: Thu, 29 Dec 1994 11:23:15 -0700
  288. Organization: cellular
  289.  
  290. In article <3du9ue$3m3@csi0.csi.UOttawa.CA>, u567510@csi.uottawa.ca
  291. (Patricke Coutue the Firste) wrote:
  292.  
  293. > On the subject of INITs, is there a way to time when the INIT runs? I want
  294. > an INIT I am running to execute AFTER QuickTime...
  295.  
  296. With respect to reliance on the way the system calls extensions, you have
  297. two options:
  298.  
  299.    (1)  Name your extension something alphabetically later than QuickTime,
  300.         document this fact, and hope that your users don't rename it.
  301.         Don't simply settle for telling them it must run last, because
  302.         that creates competition with other extensions which impose
  303.         similar requirements. I believe the usual thing to do is to prepend
  304.         a '~' onto whatever name you'd otherwise like to use.
  305.  
  306.    (2)  Have your installer put your extension in the System Folder so that
  307.         its name is less important. Users could still move your extension
  308.         into the Extensions folder, and Finder will offer to do so if the
  309.         user ever disables your extension by dragging it out of the System
  310.         Folder sub-tree and then enables it by dragging it onto the System
  311.         Folder icon.
  312.  
  313. Or, if QuickTime is not already present when your INIT is called, it can
  314. patch into some system routine and either:
  315.  
  316.    (1)  Wait for extension loading time to be over. (In general, but perhaps
  317.         not for your purposes, patching _Launch works, as do several other
  318.         things.)
  319.  
  320.    (2)  Check to see if QuickTime has been loaded every time that system
  321.         routine is called. (Patching CloseResFile and watching for QuickTime
  322.         being closed [see PBGetFCBInfo] might be useful here.)
  323.  
  324. Of course, you might wish to employ more than one of these techniques.
  325.  
  326. In all cases you must determine whether QuickTime is present before
  327. calling it. Although it is installed by default under System 7.5, users
  328. are perfectly capable of removing it.
  329.  
  330. ______________________________________________________________________________
  331.  Pete Gontier -- MacZealotry, Ink. -- gurgle@dnai.com
  332.  Where do I want to go today? Anywhere but Chicago.
  333.  
  334. +++++++++++++++++++++++++++
  335.  
  336. >From walkerj@math.scarolina.edu (James W. Walker)
  337. Date: Sat, 07 Jan 1995 21:31:11 -0500
  338. Organization: Dept. of Mathematics, Univ. of South Carolina
  339.  
  340. In article <ericstadD1v6tG.5Dx@netcom.com>, ericstad@netcom.com (Eric
  341. Stadtherr) wrote:
  342.  
  343. ...
  344. > If playing when the Finder starts up is good enough, just set up a
  345. > Notification Manager task to play the movie for you.  This will guarantee
  346. > that QuickTime has been loaded (if present).
  347.  
  348.  
  349. Slight "gotcha":  Certain extensions (Desktop Reset comes to mind) display
  350. a dialog during startup time, and cause notifications to fire
  351. prematurely.  The workaround is to make the response procedure reinstall
  352. the notification if the time is not ripe.
  353. -- 
  354.  Jim Walker
  355.  
  356. ---------------------------
  357.  
  358. >From timmyd@netcom.com (Tim DeBenedictis)
  359. Subject: How do I do a scrolling list box?
  360. Date: Tue, 10 Jan 1995 02:48:38 GMT
  361. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  362.  
  363. This is probably a FAQ, but...
  364.  
  365. How do I implement a scrolling list box in a modal dialog window?
  366. Does anybody know where I can find some reliable example code for this?
  367.  
  368. Thanks in advance,
  369.  
  370. Tim DeBenedictis
  371.  
  372.  
  373. +++++++++++++++++++++++++++
  374.  
  375. >From Lars Travers <ltravers@igc.apc.org>
  376. Date: 10 Jan 1995 16:51:40 GMT
  377. Organization: Tufts University
  378.  
  379. In article <timmydD26552.DED@netcom.com> Tim DeBenedictis,
  380. timmyd@netcom.com writes:
  381. >How do I implement a scrolling list box in a modal dialog window?
  382. >Does anybody know where I can find some reliable example code for this?
  383.  
  384. see the book _Macintosh Programming Secrets_ by Scott Knaster and Keith
  385. Rollin page 429 (2nd edition, Addison-Wesley Publishing).
  386.  
  387. +++++++++++++++++++++++++++
  388.  
  389. >From oster@netcom.com (David Phillip Oster)
  390. Date: Tue, 10 Jan 1995 17:09:35 GMT
  391. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  392.  
  393. In article <timmydD26552.DED@netcom.com> timmyd@netcom.com (Tim DeBenedictis) writes:
  394. >How do I implement a scrolling list box in a modal dialog window?
  395. >Does anybody know where I can find some reliable example code for this?
  396.  
  397. One way:
  398. in your resources:
  399. declare a user item in your ditl, and have your dialog be initially invisible.
  400.  
  401. in your program:
  402. GetNewDialog() to bring the dialog in.
  403. get your user item's rect.
  404. LNew() an appripriate listHnadle.
  405. Set the update procedure (i.e., the handle) of the user item to
  406. similarly to:
  407. static ListHandle myListHandle = NULL;
  408. static UpdateUPP        updateUPP = NULL;
  409.  
  410. static pascal void UpdateList(DialogPtr dp, short item){
  411.         LUpdate( dp->visRgn, myListHandle);
  412. }
  413.         GetItem(kDLOGsUserItem, &type, &id, &dontCare);
  414.         if(NULL != updateUPP){
  415.                 updateUPP = NewUpdateUPP(UpdateList);
  416.         }
  417.         SetItem(kDLOGsUserItem, type, id, (Handle) updateUPP);
  418.  
  419. You can ignore the UPP stuff and just set UpdateList directly into SetItem
  420. if you don't care about fat binaries. The above schema doesn't need to be
  421. modified if you are compiling for a 68000 instead of PowerPC, since 
  422. UpdateUPP will expand to a variable of type procedure pointer, and 
  423. NewUpdateUPP() just returns its argument on the 68000. On the PowerPC
  424. an appropriate data structure will be allocated and initialized.
  425.  
  426.  
  427. last things:
  428. Remember to LDispose() you list handle when you are done with it.
  429. You'll need to filter events in ModalDialog() or in your event loop,
  430. and handle clicks in the userItem yourself, by passing them to LClick
  431. (convert from global to local.)
  432.  
  433. Figure a half day for the first one.
  434. -- 
  435. - ------- oster@netcom.com ----------
  436. "A man hears what he wants to hear and misremembers the rest."
  437.      -- Paul Simon, ("The Boxer")
  438.  
  439.  
  440. +++++++++++++++++++++++++++
  441.  
  442. >From mxmora@unix.sri.com (Matthew Xavier Mora)
  443. Date: Tue, 10 Jan 1995 10:00:48 -0800
  444. Organization: SRI International
  445.  
  446. In article <timmydD26552.DED@netcom.com>, timmyd@netcom.com (Tim
  447. DeBenedictis) wrote:
  448.  
  449. > This is probably a FAQ, but...
  450. > How do I implement a scrolling list box in a modal dialog window?
  451. > Does anybody know where I can find some reliable example code for this?
  452. > Thanks in advance,
  453. > Tim DeBenedictis
  454.  
  455.  
  456. Here is a snippet that I used from Steve Falkenburg. I was using it to 
  457. test Script compiling.
  458.  
  459.  
  460.  
  461. /*
  462.    Modal Dialog TextEdit useritem snippet
  463.    Steve Falkenburg-- MacDTS
  464.    
  465.    This snippet shows the steps necessary to implement a scrolling,
  466. editable text field
  467.    in a dialog.  You may want to do this if you will be requiring the user
  468. to enter more than
  469.    255 characters (the limit for editText items), if you want a different
  470. font for several
  471.    different editText items, or it you want to add scrolling support to an
  472. editible text item.
  473. */
  474.  
  475. #include <AppleScript.h>
  476. // constants
  477.  
  478. #define  kMyDialog      128
  479. #define  kInFront    (WindowPtr)-1L
  480. #define  kEditTextItem  2
  481. #define  kScrollerItem  3
  482. #define  kMargin        4
  483. #define  kPageLines     16
  484. #define  kScrollToTop   0
  485. #define  kScrollToBottom   1
  486. #define  kMaxLines      128
  487. #define  kOSACompile    5
  488. #define  kOSAExecute    6
  489.  
  490. #pragma mark Prototypes
  491.  
  492. void main(void);
  493. void InitStuff(void);
  494. void DoDialog(void);
  495. void SetupDialog(DialogPtr theDialog);
  496. void PrepareFreeDialog(DialogPtr theDialog);
  497.  
  498. pascal void EditTextDrawProc(DialogPtr theDialog,short theItem);
  499. pascal Boolean MyDialogFilter(DialogPtr theDialog,EventRecord *ev,short
  500. *itemHit);
  501. void HandleKeyPress(DialogPtr theDialog,char theChar);
  502. void HandleIdle(DialogPtr theDialog);
  503. void HandleActivate(DialogPtr theDialog);
  504. Boolean HandleMouse(DialogPtr theDialog,Point pt,short modifiers);
  505.  
  506. void HandleScroller(DialogPtr theDialog,Point pt);
  507. pascal void ScrollBarAction(ControlHandle theControl,short part);
  508. void ScrollText(DialogPtr theDialog,short lines);
  509. void ReAlignTextToScrollbar(DialogPtr theDialog);
  510. void ReAlignScrollbarToText(DialogPtr theDialog);
  511.  
  512. pascal Boolean MyTEClickProc(void);
  513.  
  514. ControlHandle GetScrollBar(DialogPtr theDialog);
  515. TEHandle GetTEHandle(DialogPtr theDialog);
  516.  
  517. #pragma mark Globals
  518.  
  519. ModalFilterUPP       gMyDialogFilterUPP ;
  520. UserItemUPP       gEditDrawUPP;
  521. TEClickLoopUPP    gTEClickLoopUPP;
  522. ControlActionUPP  gScrollBarUPP;
  523. extern OSAID            gContext;
  524.  OSAID            gScriptID;
  525.  
  526. #pragma mark -
  527.  
  528. /* main entry point */
  529.  
  530. //----------------------------------------------------------------
  531.    void main(void)
  532. //----------------------------------------------------------------
  533. {
  534.    InitStuff();
  535.    
  536.    DoDialog();
  537.    ExitToShell();
  538. }
  539.  
  540.  
  541. /* initialize the Mac managers */
  542.  
  543. //----------------------------------------------------------------
  544.    void InitStuff(void)
  545. //----------------------------------------------------------------
  546. {
  547.    InitGraf(&qd.thePort);
  548.    InitFonts();
  549.    InitWindows();
  550.    InitMenus();
  551.    TEInit();
  552.    InitDialogs(nil);
  553.    InitCursor();
  554.    FlushEvents(everyEvent,0);
  555.    gMyDialogFilterUPP = NewModalFilterProc(MyDialogFilter);
  556.    gEditDrawUPP = NewUserItemProc(EditTextDrawProc);
  557.    gTEClickLoopUPP = NewTEClickLoopProc(MyTEClickProc);
  558.    gScrollBarUPP = NewControlActionProc(ScrollBarAction);
  559.  
  560. }
  561.  
  562. //----------------------------------------------------------------
  563.    void DoCompile(DialogPtr theDialog)
  564. //----------------------------------------------------------------
  565. {
  566.    TEHandle te = GetTEHandle(theDialog);
  567.    Handle h;
  568.    
  569.    h = (**te).hText;
  570.    HLock(h);
  571.    gScriptID = CompileText(h);
  572.    HUnlock(h);
  573. }
  574.  
  575. //----------------------------------------------------------------
  576.    void DoExecute(gScriptID)
  577. //----------------------------------------------------------------
  578. {
  579.    short err;
  580.    
  581.       err = ExecuteScript( gScriptID);
  582. }
  583.  
  584. /* display dialog, and handle pretty standard ModalDialog loop.  The modal
  585. dialog loop doesn't
  586.    handle item hits to the scroll bar or text items.  These are handled
  587. through the filter
  588.    procedure
  589. */
  590.  
  591. //----------------------------------------------------------------
  592.    void DoDialog(void)
  593. //----------------------------------------------------------------
  594. {
  595.    DialogPtr theDialog;
  596.    short item;
  597.    ControlHandle checkBoxControl;
  598.    short iType;
  599.    Rect iRect;
  600.    
  601.    theDialog = GetNewDialog(kMyDialog,nil,kInFront);
  602.    SetupDialog(theDialog);
  603.    
  604.       InitCompiler();
  605.       
  606.    do {
  607.       ModalDialog(gMyDialogFilterUPP,&item);
  608.       switch (item) {
  609.          case  kOSACompile:
  610.             DoCompile(theDialog);
  611.             break;
  612.          case  kOSAExecute:
  613.             DoExecute(gScriptID);
  614.             break;
  615.       }  
  616.    } while (item!=ok);
  617.    
  618.    PrepareFreeDialog(theDialog);
  619.    DisposeDialog(theDialog);
  620. }
  621.  
  622.  
  623. /* Creates the necessary data structures necessary to use the textedit
  624. item in our dialog.  A
  625.    handle to the TextEdit record is stored in the Dialog's window refCon field.
  626. */
  627.  
  628. //----------------------------------------------------------------
  629.    void SetupDialog(DialogPtr theDialog)
  630. //----------------------------------------------------------------
  631. {
  632.    short iType;
  633.    Handle iHndl;
  634.    Rect iRect;
  635.    ControlHandle theControl; 
  636.    short fontNum;
  637.    TEHandle theTE;
  638.    
  639.    SetPort(theDialog);
  640.    
  641.    GetDialogItem(theDialog,kScrollerItem,&iType,(Handle
  642. *)&theControl,&iRect);   // set up the scroll bar
  643.    SetCtlMin(theControl,0);                              // (it's stored
  644. in a CNTL)
  645.    SetCtlMax(theControl,kMaxLines);
  646.  
  647.    GetDItem(theDialog,kEditTextItem,&iType,&iHndl,&iRect);
  648.    SetDItem(theDialog,kEditTextItem,iType,(Handle)gEditDrawUPP,&iRect);
  649.    
  650.    InsetRect(&iRect,kMargin,kMargin);
  651.    
  652.    GetFNum("\pgeneva",&fontNum);
  653.    TextFont(fontNum);
  654.    theTE = TENew(&iRect,&iRect);       // create our textedit item
  655.    GetFNum("\pchicago",&fontNum);
  656.    TextFont(fontNum);
  657.  
  658.    TESetClickLoop(gTEClickLoopUPP,theTE);    // callback for drag-scrolling
  659.    TEAutoView(true,theTE);             // turn auto-scroll on for text entry
  660.    
  661.    SetWRefCon(theDialog,(long)theTE);
  662. }
  663.  
  664.  
  665.  
  666. /* free the memory taken by the textedit record before closing the dialog
  667. */
  668.  
  669. void PrepareFreeDialog(DialogPtr theDialog)
  670. {
  671.    TEHandle theTE;
  672.    
  673.    theTE = GetTEHandle(theDialog);
  674.    TEDispose(theTE);
  675. }
  676.  
  677.  
  678. /* dialog user item draw procedure for text box.  It just calls FrameRect
  679. */
  680.  
  681. pascal void EditTextDrawProc(DialogPtr theDialog,short theItem)
  682. {
  683.    short iType;
  684.    Handle iHndl;
  685.    Rect iRect;
  686.    GrafPtr savePort;
  687.    
  688.    GetPort(&savePort);
  689.    SetPort(theDialog);
  690.    
  691.    GetDItem(theDialog,theItem,&iType,&iHndl,&iRect);
  692.    FrameRect(&iRect);
  693.    
  694.    SetPort(savePort);
  695. }
  696.  
  697.  
  698. /* this is the main dispatcher for events to be passed off to the scroll
  699. bar or textedit box.
  700.    looks sort of like a WaitNextEvent event handler.
  701. */
  702.  
  703. pascal Boolean MyDialogFilter(DialogPtr theDialog,EventRecord *ev,short
  704. *itemHit)
  705. {
  706.    char theChar;
  707.    
  708.    switch (ev->what) {
  709.       case keyDown:
  710.       case autoKey:
  711.          theChar = (ev->message & charCodeMask);
  712.          HandleKeyPress(theDialog,theChar);
  713.          return true;
  714.       case nullEvent:
  715.          HandleIdle(theDialog);
  716.          return false;
  717.       case activateEvt:
  718.          HandleActivate(theDialog);
  719.          return false;
  720.       case mouseDown:
  721.          return HandleMouse(theDialog,ev->where,ev->modifiers);
  722.       default:
  723.          return false;
  724.    }
  725. }
  726.  
  727.  
  728. /* dialog filter event handler for keypresses.  All keypresses are passed
  729. to the textedit box
  730. */
  731.  
  732. void HandleKeyPress(DialogPtr theDialog,char theChar)
  733. {
  734.    TEHandle theTE;
  735.  
  736.    theTE = GetTEHandle(theDialog);
  737.    TEKey(theChar,theTE);
  738.    ReAlignScrollbarToText(theDialog);
  739. }
  740.  
  741.  
  742. /* handler for null events.  used in our case to blink the insertion point
  743. */
  744.  
  745. void HandleIdle(DialogPtr theDialog)
  746. {
  747.    TEHandle theTE;
  748.  
  749.    theTE = GetTEHandle(theDialog);
  750.    TEIdle(theTE);
  751. }
  752.  
  753.  
  754. /* activate event handler.  we take this opportunity to call TEActivate to
  755. activate the textedit
  756.    box
  757. */
  758.  
  759. void HandleActivate(DialogPtr theDialog)
  760. {
  761.    TEHandle theTE;
  762.  
  763.    theTE = GetTEHandle(theDialog);
  764.    TEActivate(theTE);
  765. }
  766.  
  767.  
  768. /* mouse-down hander.  here, we see if the mousedown was in the scrollbar
  769. or in the textedit
  770.    record.  if in the textedit item, we call teclick.  If in the
  771. scrollbar, we call handlescroller
  772.    to do further processing
  773. */
  774.  
  775. Boolean HandleMouse(DialogPtr theDialog,Point pt,short modifiers)
  776. {
  777.    short iType;
  778.    Handle iHndl;
  779.    Rect textRect,scrollerRect;
  780.    TEHandle theTE;
  781.    GrafPtr savePort;
  782.    Boolean shiftDown,result;
  783.    ControlHandle theControl;
  784.    short part;
  785.    
  786.    GetPort(&savePort);
  787.    SetPort(theDialog);
  788.    
  789.    shiftDown = modifiers & shiftKey;
  790.    GlobalToLocal(&pt);
  791.    
  792.    GetDItem(theDialog,kEditTextItem,&iType,&iHndl,&textRect);
  793.    GetDItem(theDialog,kScrollerItem,&iType,&iHndl,&scrollerRect);
  794.    
  795.    if (PtInRect(pt,&textRect)) {
  796.       theTE = GetTEHandle(theDialog);
  797.       TEClick(pt,shiftDown,theTE);
  798.       result = true;
  799.    }
  800.    else if (PtInRect(pt,&scrollerRect)) {
  801.       HandleScroller(theDialog,pt);
  802.       result = true;
  803.    }
  804.    else
  805.       result = false;
  806.       
  807.    SetPort(savePort);
  808.    
  809.    return result;
  810. }
  811.  
  812.  
  813. /* here, we see which part of the scrollbar was clicked in by calling
  814. findcontrol.  trackcontrol
  815.    is then called with the appropriate action proc if in one of the
  816. buttons or page areas.  if
  817.    in the thumb, the text is simply re-aligned to the new scrollbar position
  818. */
  819.  
  820. void HandleScroller(DialogPtr theDialog,Point pt)
  821. {
  822.    short part;
  823.    ControlHandle theControl;
  824.    
  825.    part = FindControl(pt,theDialog,&theControl);
  826.    switch (part) {
  827.       case inUpButton:
  828.       case inDownButton:
  829.       case inPageUp:
  830.       case inPageDown:
  831.          TrackControl(theControl,pt,gScrollBarUPP);
  832.          break;
  833.       case inThumb:
  834.          TrackControl(theControl,pt,nil);
  835.          ReAlignTextToScrollbar(theDialog);
  836.          break;
  837.    }
  838. }
  839.  
  840.  
  841. /* trackcontrol callback used to determine which direction to scroll the
  842. text, and by how much.
  843.    once this is known, the text is scrolled, and the scrollbar adjusted.
  844. */
  845.  
  846. pascal void ScrollBarAction(ControlHandle theControl,short part)
  847. {
  848.    DialogPtr theDialog;
  849.    short lines;
  850.    short ctlValue,ctlMax,ctlMin;
  851.    
  852.    ctlMax = GetCtlMax(theControl);
  853.    ctlMin = GetCtlMin(theControl);
  854.    ctlValue = GetCtlValue(theControl);
  855.    
  856.    theDialog = (*theControl)->contrlOwner;
  857.    
  858.    switch (part) {
  859.       case inUpButton:
  860.          lines = -1;
  861.          break;
  862.       case inDownButton:
  863.          lines = 1;
  864.          break;
  865.       case inPageUp:
  866.          lines = -kPageLines;
  867.          break;
  868.       case inPageDown:
  869.          lines = kPageLines;
  870.          break;
  871.       default:
  872.          return;
  873.    }
  874.  
  875.    if ((ctlValue+lines)>ctlMax)
  876.       lines = ctlMax-ctlValue;
  877.    if ((ctlValue+lines)<ctlMin)
  878.       lines = ctlMin-ctlValue;
  879.       
  880.    if (lines!=0) {
  881.       ScrollText(theDialog,lines);
  882.       SetCtlValue(theControl,ctlValue+lines);
  883.    }
  884. }
  885.  
  886.  
  887. /* sets the text top line to be the same as the current scrollbar
  888. position.  this is called after
  889.    a thumb movement in the scrollbar.
  890. */
  891.  
  892. void ReAlignTextToScrollbar(DialogPtr theDialog)
  893. {
  894.    TEHandle theTE;
  895.    ControlHandle scrollBar;
  896.    short controlScrollPosition,textScrollPosition,scrollDelta,scrollPix;
  897.    
  898.    theTE = GetTEHandle(theDialog);
  899.    scrollBar = GetScrollBar(theDialog);
  900.    
  901.    controlScrollPosition = GetCtlValue(scrollBar);
  902.    textScrollPosition = ((**theTE).viewRect.top - (**theTE).destRect.top)
  903. / (**theTE).lineHeight;
  904.    scrollDelta = textScrollPosition - controlScrollPosition;
  905.    scrollPix = scrollDelta * (*theTE)->lineHeight;
  906.    TEScroll(0,scrollPix,theTE);
  907. }
  908.  
  909.  
  910. /* sets the scrollbar thumb to the current text position.  this is called
  911. after autoscrolling,
  912.    which may occur after a call to TEKey, or during a drag-scroll
  913. */
  914.  
  915. void ReAlignScrollbarToText(DialogPtr theDialog)
  916. {
  917.    TEHandle theTE;
  918.    ControlHandle scrollBar;
  919.    short textScrollPosition;
  920.       
  921.    theTE = GetTEHandle(theDialog);
  922.    scrollBar = GetScrollBar(theDialog);
  923.    
  924.    textScrollPosition = ((**theTE).viewRect.top - (**theTE).destRect.top)
  925. / (**theTE).lineHeight;
  926.    SetCtlValue(scrollBar,textScrollPosition);
  927. }
  928.  
  929.  
  930. /* scrolls the text by the delta passed in to the function.  called in
  931. response to clicking the
  932.    arrows or page areas of the scrollbar to move the text
  933. */
  934.  
  935. void ScrollText(DialogPtr theDialog,short lines)
  936. {
  937.    TEHandle theTE;
  938.    short scrollPix;
  939.    short textScrollPosition;
  940.    
  941.    theTE = GetTEHandle(theDialog);
  942.  
  943.    textScrollPosition = ((**theTE).viewRect.top - (**theTE).destRect.top)
  944. / (**theTE).lineHeight;
  945.    if ((textScrollPosition+lines)<0)
  946.       lines = -textScrollPosition;
  947.    if ((textScrollPosition+lines)>kMaxLines)
  948.       lines = kMaxLines-textScrollPosition;
  949.             
  950.    scrollPix = lines * (*theTE)->lineHeight;
  951.    
  952.    TEScroll(0,-scrollPix,theTE);
  953. }
  954.  
  955.  
  956. /* text drag callback procedure.  this routine handles drag scrolling by
  957. checking to see if we
  958.    are in the area where drag-scrolling is necessary, and calling
  959. scrolltext followed by a
  960.    scrollbar realignment
  961. */
  962.  
  963. pascal Boolean MyTEClickProc(void)
  964. {
  965.    Point pt;
  966.    DialogPtr theDialog;
  967.    ControlHandle theControl;
  968.    TEHandle theTE;
  969.    Rect textRect;
  970.    short scrollLines;
  971.    GrafPtr savePort;
  972.    RgnHandle saveClip;
  973.       
  974.    GetMouse(&pt);
  975.    theDialog = (DialogPtr)FrontWindow();
  976.    theTE = GetTEHandle(theDialog);
  977.    
  978.    GetPort(&savePort);
  979.    SetPort(theDialog);
  980.  
  981.    saveClip = NewRgn();
  982.    GetClip(saveClip);
  983.    ClipRect(&theDialog->portRect);
  984.  
  985.    scrollLines = 0;
  986.    textRect = (**theTE).viewRect;
  987.    if (pt.v < textRect.top)
  988.       scrollLines = -1;
  989.    else if (pt.v > textRect.bottom)
  990.       scrollLines = 1;
  991.    
  992.    if (scrollLines) {
  993.       ScrollText(theDialog,scrollLines);
  994.       ReAlignScrollbarToText(theDialog);
  995.    }
  996.    
  997.    SetClip(saveClip);
  998.    DisposeHandle((Handle)saveClip);
  999.    SetPort(savePort);
  1000.    return true;
  1001. }
  1002.  
  1003.  
  1004. /* utility procedure to return a handle to the scrollbar control
  1005. */
  1006.  
  1007. ControlHandle GetScrollBar(DialogPtr theDialog)
  1008. {
  1009.    ControlHandle theScroller;
  1010.    short iType;
  1011.    Rect iRect;
  1012.    
  1013.    GetDItem(theDialog,kScrollerItem,&iType,(Handle *)&theScroller,&iRect);
  1014.    return theScroller;
  1015. }
  1016.  
  1017.  
  1018. /* utility procedure to return the textedit record for the given dialog */
  1019.  
  1020. TEHandle GetTEHandle(DialogPtr theDialog)
  1021. {
  1022.    return( (TEHandle)GetWRefCon((WindowPtr)theDialog) );
  1023. }
  1024.  
  1025. -- 
  1026. __________________________________________________________________
  1027. Matthew Xavier Mora  (cybernaut)            The keeper of the UMPG
  1028. SRI International                              mxmora@unix.sri.com
  1029. __________________________________________________________________
  1030.  
  1031. ---------------------------
  1032.  
  1033. >From sandvik@apple.com (Kent Sandvik)
  1034. Subject: Latest QuickTime Tech Notes
  1035. Date: Sat, 07 Jan 1995 20:03:20 -0800
  1036. Organization: Apple Computer, Inc. Developer Technical Support
  1037.  
  1038. We have brand new (sort of) Tech Notes for QuickTime, these will go out
  1039. with various developer distributions, but I uploaded them to the
  1040. ftp.apple.com dts directory (dts/multimedia/quicktime), or:
  1041.  
  1042. "ftp://ftp.apple.com/dts/multimedia/quicktime/LatestTNs/QT01 - QuickTime.hqx"
  1043. "ftp://ftp.apple.com/dts/multimedia/quicktime/LatestTNs/QT02 - QuickTime
  1044. Comp.hqx"
  1045. "ftp://ftp.apple.com/dts/multimedia/quicktime/LatestTNs/QT03 - QTW.hqx"
  1046.  
  1047. What's new since the last time any QuickTime related TNs were released?
  1048.  
  1049. * There's just these three Tech Notes, they all correspond to the Inside
  1050. Macintosh QuickTime books, even on chapter level. If you don't find
  1051. something in the NIM QuickTime books in a chapter, do a second lookup in
  1052. the Tech Notes. This is easier than searching in a multitude of Tech
  1053. Notes. Thus, all information is re-classified so it falls into the
  1054. categories defined by the NIM books.
  1055.  
  1056. * The Q&A entries are in many cases rewritten and placed into these Tech
  1057. Notes as well, so you don't need to check these TNs out as well (they are
  1058. gone).
  1059.  
  1060. * All relevant information up to December 1994 is now in the Tech Notes,
  1061. including email Q&A entries DTS has answered for the last 12 months.  This
  1062. also includes errata notes concerning the NIM QuickTime books.
  1063.  
  1064. * Anything not relevant to QT 2.0/1.6.1 is now out from the Tech Notes.
  1065.  
  1066. In future we hope to update these TNs more frequently, for instance it's
  1067. doable to publish a separate delta document with the new information since
  1068. December 1994, so if you want to just check out what's new you don't need
  1069. to read the bigger Tech Notes (even if it's in there as well).
  1070.  
  1071. If you have any feedback about the Tech Notes, the contents or the
  1072. process, feel free to send me an email. You should see these TNs appearing
  1073. over the normal channels, but I didn't want them to gather dust as they
  1074. are finished already :-).
  1075.  
  1076.  
  1077. --Kent
  1078.  
  1079. -- 
  1080. Kent Sandvik   sandvik@apple.com   New Media Analyst/Programmer
  1081. Private activities on Internet.
  1082.  
  1083. ---------------------------
  1084.  
  1085. >From jdv@netcom.com (Julian Vrieslander)
  1086. Subject: OpenDoc mailing list or FAQ?
  1087. Date: Sat, 7 Jan 1995 23:27:12 GMT
  1088. Organization: Cornell University, Ithaca, NY
  1089.  
  1090. Title line pretty much sums it up.  Besides the articles in MacTech and
  1091. the OpenDoc CD-ROM, where should I look for info to help me come up to
  1092. speed on OpenDoc?
  1093.  
  1094. -- 
  1095.                        Julian Vrieslander
  1096.                jdv@netcom.com      jdv2@cornell.edu
  1097.  
  1098. +++++++++++++++++++++++++++
  1099.  
  1100. >From Alan Harper <aharper@dnai.com>
  1101. Date: 7 Jan 1995 18:05:31 GMT
  1102. Organization: Eclectus
  1103.  
  1104. In article <jdvD226HD.J6y@netcom.com> Julian Vrieslander, jdv@netcom.com
  1105. writes:
  1106. > Title line pretty much sums it up.  Besides the articles in MacTech and
  1107. > the OpenDoc CD-ROM, where should I look for info to help me come up to
  1108. > speed on OpenDoc?
  1109.  
  1110. send a message
  1111. SUBSCRIBE OPENDOC-ANNOUNCE <your name>
  1112. SUBSCRIBE OPENDOC-INTEREST <your name>
  1113.  
  1114. to listproc@CILabs.ORG
  1115.  
  1116. - ---------------
  1117. Alan Harper                       aharper@dnai.com
  1118. 77 Jack London Sq, Ste. H         510/444-6605 (voice/fax)
  1119. Oakland, CA 94607
  1120.  
  1121. ---------------------------
  1122.  
  1123. >From ericg@cs.uoregon.edu (MystryMan)
  1124. Subject: Q: Bedrock Exception Library Questions
  1125. Date: 9 Jan 1995 15:43:17 -0800
  1126. Organization: University of Oregon Computer and Information Sciences Dept.
  1127.  
  1128. I was reading through some of the CodeWarrior documentation and it said that
  1129.  
  1130. "The Bedrock Exception Library which was added to the TCL in version 2.0 seems
  1131. to be somewhat buggy, especially on the PowerPC"
  1132.  
  1133. Unfortunatly, it does not go on to specify where these bugs come into play,
  1134. what they are or how to avoid them.
  1135.  
  1136. I would like to continue to use the BEL for now and would like more information
  1137. on what these bugs are.
  1138.  
  1139. Thanx..
  1140.  
  1141. ===Eric Gorr================ericg@cs.uoregon.edu===========aka MystryMan===
  1142. _____ 
  1143. |\ /| * Invincibility is in oneself, vulnerability is in the opponent
  1144. | O | * Therefore the considerations of the intelligent always include both
  1145. |/_\|   benefit and harm (Sun Tzu)
  1146.  
  1147. #include <standard.disclaimer>
  1148. =====Insults, like violence, are the last resort of the incompetent...=====
  1149.  
  1150.  
  1151. +++++++++++++++++++++++++++
  1152.  
  1153. >From afcjlloyd@aol.com (AFC JLloyd)
  1154. Date: 11 Jan 1995 17:15:35 -0500
  1155. Organization: America Online, Inc. (1-800-827-6364)
  1156.  
  1157. >I was reading through some of the CodeWarrior documentation and it said
  1158. that
  1159. >
  1160. >"The Bedrock Exception Library which was added to the TCL in version 2.0
  1161. seems
  1162. >to be somewhat buggy, especially on the PowerPC"
  1163. >
  1164. >Unfortunatly, it does not go on to specify where these bugs come into
  1165. play,
  1166. >what they are or how to avoid them.
  1167. >
  1168. >I would like to continue to use the BEL for now and would like more
  1169. information
  1170. >on what these bugs are.
  1171.  
  1172. I'm the engineer who has done most of the work on BEL.  There is an
  1173. extensive test suite for BEL that was written by myself and a quality
  1174. assurance engineer (David Dodd).  We've run that test suite on multiple
  1175. compilers and platforms (Symantec C++ for MPW, Symantec C++ for Think
  1176. Project Manager, Symantec C++ for Windows, Borland C++, Metrowerks C++,
  1177. Apple's MrC).  BEL is being used in shipping applications on both Mac and
  1178. Windows.
  1179.  
  1180. I have heard rumors that BEL is buggy.  When looking into these rumors the
  1181. only problem that I have been able to confirm is one where a register
  1182. value is not preserved across the longjmp.  This is easily fixed by proper
  1183. use of the C++ keyword volatile.  If you need a local value to be
  1184. preserved from the TRY block to the CATCH block when an exception is
  1185. thrown, be sure to declare the value volatile.  Here are some examples:
  1186.  
  1187. TRY
  1188. {
  1189.      volatile int i;
  1190.      CMyClass * volatile myClassPtr;
  1191. }
  1192.  
  1193. Note the postion of the volatile keyword when declaring a pointer.  The
  1194. keyword must come after the *, not before.
  1195.  
  1196. If anyone is aware of any bugs in BEL, please send mail to me at one of
  1197. the addresses below.  To my knowledge there are NO bugs in BEL, though
  1198. there are some limitations that may not be fully documented.  Here are two
  1199. limitations to be aware of:
  1200.  
  1201. BEL has a hard time in some cases with TRY/CATCH blocks nested inside of a
  1202. CATCH block.  In particular, you can only THROW_SAME from within the
  1203. innermost nested CATCH block.
  1204.  
  1205. If you want to embed an autodestruct object by value inside of another
  1206. object, then the outer object must also be an autodestruct object, and it
  1207. should have the END_CONSTRUCTOR/START_DESTRUCTOR macros inside of its
  1208. constructors and destructor.
  1209.  
  1210. Finally be aware of the fact that if you don't create one, the compiler
  1211. will write a copy constructor for you.  A compiler-generated copy
  1212. constructor won't have the END_CONSTRUCTOR macro.  If the destructor has a
  1213. START_DESTRUCTOR macro, then you will get an assertion failure when that
  1214. object is destroyed.
  1215.  
  1216. Jim Lloyd
  1217. afcjlloyd@aol.com -or- Jim_Lloyd@powertalk.apple.com
  1218.  
  1219. ---------------------------
  1220.  
  1221. >From allender@prairienet.org (Mark W. Allender)
  1222. Subject: help with CLUT-Palette management
  1223. Date: 10 Jan 1995 20:01:15 GMT
  1224. Organization: Prairienet, the East-Central Illinois Free-Net
  1225.  
  1226.  
  1227. I have a very simple problem that I am trying desperately to solve.
  1228.  
  1229. I have a palette of 256 colors that I want to display in a simple little
  1230. grid format.  I am having no trouble doing the actual drawing.  The problem
  1231. is that I don't understand (after wading through endless volumes of Inside
  1232. Macintosh, developer notes, etc) how the palette and color table manager
  1233. work to produce colors for a particular window.
  1234.  
  1235. In my case, all I want to do is replace the first 256 entries in my
  1236. windows color table, and draw my little grid.  It appears to me that I
  1237. still have the system colors when I do this.
  1238.  
  1239. What I tried initially was to create a Palette with my entries, used
  1240. palette2CTab, and then placed the CTable into the Pixmap area pointed
  1241. to by the window that I created.  Sounded simple, but doesn't work.
  1242.  
  1243. Can some kind soul help me out with this seemingly simple task.  Thanks
  1244. in advance!!!
  1245.  
  1246. --
  1247. -Mark Allender
  1248. -Parallax Software
  1249. -allender@prairienet.org
  1250.  
  1251. +++++++++++++++++++++++++++
  1252.  
  1253. >From gurgle@dnai.com (Pete Gontier)
  1254. Date: Tue, 10 Jan 1995 18:41:18 -0700
  1255. Organization: cellular
  1256.  
  1257. In article <3eup2b$oae@vixen.cso.uiuc.edu>,
  1258. allender@prairienet.org (Mark W. Allender) wrote:
  1259.  
  1260. > In my case, all I want to do is replace the first 256 entries in my
  1261. > windows color table...
  1262.  
  1263. No you don't. :-) The window color table describes the colors to use for
  1264. drawing various parts of the window itself, not the image in the window's
  1265. content region, which is what you are drawing.
  1266.  
  1267. > What I tried initially was to create a Palette with my entries, used
  1268. > palette2CTab, and then placed the CTable into the Pixmap area pointed
  1269. > to by the window that I created...
  1270.  
  1271. This certainly does something, but I'm not sure what. :-) You took too
  1272. many steps. All you want to do is:
  1273.  
  1274.         (1) build a palette
  1275.         (2) call GetPalette to see if the window already has a palette;
  1276.             if so, I believe you can call DisposePalette against it,
  1277.             but I'm shooting from the hip here as palettes may be shared;
  1278.             someone else should verify this info
  1279.         (3) call SetPalette
  1280.  
  1281. I sympathize with your plight; finding Palette Manager documentation is
  1282. non-trivial these days.
  1283.  
  1284. ______________________________________________________________________________
  1285.  Pete Gontier -- MacZealotry, Ink. -- gurgle@dnai.com
  1286.  Where do I want to go today? Anywhere but Chicago.
  1287.  
  1288. ---------------------------
  1289.  
  1290. End of C.S.M.P. Digest
  1291. **********************
  1292.